<include file="Public/min-header" />
<div class="wrapper">
	<include file="Public/breadcrumb" />
	<section class="content">
		<div class="row">
			<div class="col-xs-12">
				<div class="box">
					<div class="box-header">
						<nav class="navbar navbar-default">
							<div class="collapse navbar-collapse">
								<div class="navbar-form form-inline">
									<div class="form-group">
										<p class="text-success margin blod">店铺:</p>
									</div>
									<div class="form-group">

										<a class="btn btn-info" href="{:U('Store/apply_list')}">开店申请</a>&nbsp;&nbsp;&nbsp;&nbsp; 点击右边操作进行：通过、拒绝、删除（请谨慎操作）
									</div>
								</div>
							</div>
						</nav>

					</div>
					<div class="box-body">
						<div class="row">
							<div class="col-sm-12">
								<table id="list-table" class="table table-bordered table-striped dataTable">
									<thead>
										<tr role="row">
											<th>店铺名称</th>
											<th>店主买家昵称</th>
											<th>店铺类型</th>
											<th>联系人</th>
											<th>联系电话</th>
											<th>描述</th>
											<th>申请时间</th>
											<th>状态</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										<foreach name="list" item="vo" key="k">
											<tr role="row">
												<td>{$vo.sellername}</td>
												<td>{$vo.nick_name}</td>
												<th>{$vo.sellerxm}</th>
												<td>{$vo.sellerccontactname}</td>
												<td>{$vo.sellerccontactphone}</td>
												<td>{$vo.sellerdesc}</td>
												<td>{$vo.add_time|date='Y-m-d',###}</td>
												<td>
													<if condition="$vo[status] eq 0">新申请
														<elseif condition="$vo[status] eq 2" />未通过
														<else/>开店成功</if>
												</td>
												<td>
													<if condition="$vo[status] eq 0">
														<img width="20" height="20" src="__PUBLIC__/images/yes.png" onclick="change('{$vo.id}',1)" />

														<img width="20" height="20" src="__PUBLIC__/images/cancel.png" onclick="change('{$vo.id}',2)" />
													</if>
													<a class="btn btn-danger" href="{:U('Store/apply_del',array('del_id'=>$vo['id']))}">
														<i class="fa fa-trash-o"></i>
													</a>
												</td>
											</tr>
										</foreach>
									</tbody>
									<tfoot>

									</tfoot>
								</table>
							</div>
						</div>
						<div class="row">
							<div class="col-sm-6 text-left">
								<button class="btn btn-default btn-sm checkbox-toggle">
									<i class="fa fa-square-o"></i>
								</button>
							</div>
							<div class="col-sm-6 text-right">{$page}</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>
	<script>

		//修改指定表的指定字段值 给商家使用的函数
		function change(id, status) {

			$.ajax({
				url: "/index.php?m=Admin&c=Store&a=change&id=" + id + "&status=" + status,
				success: function (data) {
					window.location.href = "/index.php?m=Admin&c=Store&a=apply_list";
				}
			});
		}

	</script>
</div>
</body>

</html>